const express = require('express');
const axios = require('axios');
let app = express();
app.get('/', (req, res) => {
    res.header("Access-Control-Allow-Origin", "*");
    res.header("Access-Control-Allow-Methods", "PUT,POST,GET,DELETE,OPTIONS");
    res.header("Access-Control-Allow-Headers", "Content-Type,Content-Length, Authorization, Accept,X-Requested-With");
    axios.get("https://tenapi.cn/resou").then((ress) => {
        res.json(ress.data)
    })
});

app.get('/img', (req, res) => {
    res.header("Access-Control-Allow-Origin", "*");
    res.header("Access-Control-Allow-Methods", "PUT,POST,GET,DELETE,OPTIONS");
    res.header("Access-Control-Allow-Headers", "Content-Type,Content-Length, Authorization, Accept,X-Requested-With");
    axios.get("http://cn.bing.com/HPImageArchive.aspx?format=js&idx=0&n=1").then((ress) => {
            res.json(ress.data)
        })
        //需要拼接http://s.cn.bing.net
})

app.listen(2000)